What 3 dots does in React or Typescript

Three dots {…props} decompiles array and used to merge an array with individual variables

  const linkProps = {
    ...props,
    ...(customname === true ? { passHref: true } : {})
  }

Leave a Reply